<% if @restaurant.errors.any? %>
    <div class="row">
        <div class="col-md-12">
          <div class="alert alert-danger">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
            <ul>
              <% @restaurant.errors.full_messages.each do |message| %>
                <li><%= message %></li>
              <% end %>                     
            </ul>                                             
          </div>
        </div>
 </div>
<% end %>

<div class="form-group">
  <label class="col-md-12">店铺名称*</label>
  <div class="col-md-12">
       <%= f.text_field :name,class:"form-control",label:false,placeholder:"请输入店铺名称"%>
  </div>
</div>

<div class="form-group">
  <label class="col-md-12">店铺餐桌数(用于生成二维码)</label>
  <div class="col-md-12">
       <%= f.text_field :total_tables,class:"form-control",label:false,placeholder:"请输入店铺餐桌数"%>
  </div>
</div>

<div class="form-group">
  <label class="col-md-12">店铺电话</label>
  <div class="col-md-12">
       <%= f.text_field :phone,class:"form-control",label:false,placeholder:"请输入店铺电话"%>
  </div>
</div>

<div class="form-group">
  <label class="col-sm-12">封面图上传</label>
  <div class="col-sm-12">
  <div class="fileinput fileinput-new input-group" data-provides="fileinput">
    <div class="form-control" data-trigger="fileinput"> 
      <i class="glyphicon glyphicon-file fileinput-exists"></i> <span class="fileinput-filename"></span>
    </div>
    <span class="input-group-addon btn btn-default btn-file"> <span class="fileinput-new">选择封面图</span> <span class="fileinput-exists">更改</span>
    <%= f.file_field :attachment %>
    </span> <a href="#" class="input-group-addon btn btn-default fileinput-exists" data-dismiss="fileinput">删除</a> </div>
  </div>
</div>

<div class="form-group">
  <label class="col-md-12">店铺地址</label>
  <div class="col-md-12">
       <%= f.text_field :address,class:"form-control",label:false,placeholder:"请输入店铺地址"%>
  </div>
</div>

<div class="form-group">
  <label class="col-md-12">店铺简短描述</label>
  <div class="col-md-12">
    <%= f.text_field :description,class:"form-control",label:false,placeholder:"请输入店铺描述"%>
  </div>
</div>

<div class="form-group">
  <label class="col-md-12">菜品描述</label>
  <div class="col-md-12">
     <%= f.text_area :bulletion,rows:6,class: 'form-control'%>
  </div>
</div>

<div class="form-group m-b-0">
    <div class="col-sm-offset-3 col-sm-9">
      <button type="submit" class="btn btn-info waves-effect waves-light m-t-10">确定</button>
      <%= link_to("取消", "/restaurants/info/show" , class:"btn btn-default waves-effect waves-light m-t-10") %>
    </div>
</div>


